home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 May: Tool Chest / Developer CD Series May 1996 (Tool Chest) (Apple Computer) (1996).iso / Sample Code / SCSI Samples 1.0 / SCSI Driver Example 06⁄07 ƒ / disk.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-06-16  |  1.9 KB  |  69 lines  |  [TEXT/MPS ]

  1. /*******************************************************************************
  2.  
  3.     File:        disk.h
  4.  
  5.     Contains:    
  6.         Contains most of the defines for the SCSI disk driver.
  7.                         
  8.     Written by:    
  9.         Nobody would admit to it.
  10.  
  11.     Copyright:    © 1986-1993 by Apple Computer, Inc., all rights reserved.
  12.  
  13.  
  14. *******************************************************************************/
  15.  
  16.  
  17. #define     MAXRETRIES    16
  18.  
  19. /* various flags */
  20. #define READ_F        0
  21. #define WRITE_F        1
  22.  
  23. /* internal driver error codes (returned by scsiop routine) */
  24. #define ARB_ERR        -1
  25. #define SEL_ERR        -2
  26. #define CMD_ERR        -3
  27. #define COMPL_ERR    -4
  28. #define SENSE_ERR    -7
  29. #define    CHK_CND        -8
  30.  
  31. #define DRVQHDR        0x308            /* drive queue header */
  32.  
  33. #define BLKSIZE        512
  34.  
  35. #define    REFNUMTOID(x)    (~(x) - 32)    /* gets the SCSI ID from driver refnum */
  36. #define IDTOREFNUM(x)    (~(32 + x)) /* SCSI ID number to refnum (converse of above) */
  37.  
  38. #define NODRVNUM    0xFFFF        /* Used to show that an entry in the pv array is empty. */
  39.  
  40. /* Values returned by GetPartitionType. */
  41. #define ISMACDRIVER        1    /* Partition is of type Apple_Driver for the Macintosh. */
  42. #define ISHFS            2    /* Partition is of type Apple_HFS, should be mounted. */
  43. #define ISNOTADDTOQUEUE    3    /* Partition is of types Apple_partition_map, Apple_Free or Apple_Scratch. */
  44.  
  45. /* Used to determine if these traps exist. */
  46. #define SDTRAP        0x95
  47. #define UNIMPTRAP    0x9F
  48. #define    SCSIATOM    0x89
  49.  
  50. #define    ASYNC        0x400            /* Asynchronous bit in ioTrap */
  51. #define IMMED        0x200            /* Immediate bit in ioTrap */
  52.  
  53. #define MAXPARTITIONS    20            /* Number of partitions per drive */
  54.  
  55. /*
  56.  * Beware: this is not transportable
  57.  */
  58. typedef struct {            /* Definition of a packed device ident */
  59.     unsigned    targetID :    5;    /* TargetID */
  60.     unsigned    LUN :        3;    /* LUN */
  61. } PackedDevID;
  62.  
  63. /* The following defines refer to the items in knownPartitionTypes. */
  64. #define POS_BEGIN 0
  65. #define POS_APPLE_DRIVER 0
  66. #define POS_APPLE_HFS 1
  67. #define POS_END 5
  68.  
  69.